var xmlhttp;
function invokeEmailService(email) {
	jQuery("#mail_notif_error").hide();
	var re = /\S+@\S+\.\S+/;
	if (re.test(email)) {
		xmlhttp = null;
		if (window.XMLHttpRequest) {// code for IE7, Firefox, Opera, etc.
			xmlhttp = new XMLHttpRequest();
		} else if (window.ActiveXObject) {// code for IE6, IE5
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		if (xmlhttp != null) {
			xmlhttp.onreadystatechange = state_Change;
			var url = "/notification?email=" + email;
			xmlhttp.open("GET", url, true);
			xmlhttp.send(null);
		} else {
			alert("Your browser does not support XMLHTTP.");
		}
	} else {
		//alert("Please enter a valid email address");
		jQuery("#mail_notif_error").show("fast");
	}
}

function state_Change() {
	if (xmlhttp.readyState == 4) {// 4 = "loaded"
		if (xmlhttp.status == 200) {
			// 200 = "OK"
			jQuery("#notificationDiv").hide("fast", arguments.callee);
			jQuery("#span_notif").show("fast", arguments.callee);

		} else {
			alert("Problem invoking Email Service :" + xmlhttp.statusText);
		}
	}
}
